package javacommon.authority.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Org extends Model<Org>{
	public static final Org dao = new Org();

	public List<Org> findByUserId(String id) {
		return dao
				.find("select id,name from t_org where id in (select orgId from t_user_org where userId=?)",
						id);
	}

	public List<Org> findAll() {
		String select = "select * from t_org";;
		return dao.find(select);
	}
}
